#pragma once
#include "AStarMechine.h"
#include "AStarSimpleGoal.h"
#include <vector>
namespace Core
{

template<class Map>
class PathFinder
{
	Map& mMap;	
public:
	PathFinder(Map& map);
	void GetPach(Position& start,Position& des,boost::ptr_list<WayPoint>& path);

};

template<class Map>
PathFinder<Map>::PathFinder(Map &map)
:mMap(map)
{}
template<class Map>
void PathFinder<Map>::GetPach(Position& start,Position& des,boost::ptr_list<WayPoint>& path)
{
	AStarSimpleGoal goal(mMap,start,des);
	AStarMechine<AStarSimpleGoal,Map,80> mechine(mMap,goal);
	mechine.Run();
	mechine.GetPath(path);
}
}